<?php
/**
 * This is the page footer element that will be rendered any time a page is loaded.
 * @author Gideon Amissah<kuulmek@yahoo.com>
 * @access public
 * @version 1.0
 */
# Instance of Organisation Model
$moduleObj =  ClassRegistry::init('Group');
$modulesData = $moduleObj->getGroupById($authUser['group_id']);

$navModules =  $modulesData['Module'];
$output_str = '';

$icons = array(
    'Dashboard'=>'shortcut-dashboard',
    'Administration'=>'shortcut-messages',
    'Customers'=>'shortcut-agenda',
    'Report'=>'shortcut-stats',
    'CreditControl'=>'shortcut-notes',
    'Items'=>'shortcut-settings',
    'Sales'=>'shortcut-contacts',
    'EditSales'=>'shortcut-medias',
    'Proforma'=>'shortcut-paper'
);

?>
<!-- Side tabs shortcuts -->
<ul id="shortcuts" role="complementary" class="children-tooltip tooltip-right">
    <li class="<?php echo ($this->params['controller'] == 'Dashboard' && $this->params['action'] == 'index')? 'current': ''; ?>">
        <?php
            echo $this->Html->link(__('Dashboard',true), array('controller' =>'Dashboard', 'action' =>'index'),array('class'=>$icons['Dashboard'],'title'=>'Dashboard'));
        ?>
    </li>
    <?php
    if(!empty($navModules) && $this->params['controller'] != 'Dashboard'){
        foreach($navModules as $module){
            $url_array = explode('/', $module['url']);
            $img = $this->Html->image($module['icon'], array('alt' => $module['name'],'border'=>0));
        ?>
            <!--<li class="<?php /*echo ($this->params['controller'] ==  $url_array[0] && $this->params['action'] ==  $url_array[1])? 'current': ''; */?>">-->
            <li class="<?php echo ($this->params['controller'] ==  $url_array[0])? 'current': ''; ?>">
            <?php
               //echo $this->Html->link(__('Messages',true), array('controller' =>'Dashboard', 'action' =>'messages'),array('class'=>'shortcut-messages','title'=>'Messages'));
               echo $this->Html->link(__($module['name'],true), array('controller' =>  $url_array[0], 'action' => $url_array[1]),array('class'=>$icons[$url_array[0]],'title'=>$module['name']))
            ?>
            </li>
        <?php
        }
    }
    ;?>
    <!--<li class="<?php /*echo ($this->params['controller'] == 'Dashboard' && $this->params['action'] == 'messages')? 'current': ''; */?>">
        <?php
/*            echo $this->Html->link(__('Messages',true), array('controller' =>'Dashboard', 'action' =>'messages'),array('class'=>'shortcut-messages','title'=>'Messages'));
        */?>
    </li>
    <li class="<?php /*echo ($this->params['controller'] == 'Dashboard' && $this->params['action'] == 'agenda')? 'current': ''; */?>">
        <?php
/*            echo $this->Html->link(__('Agenda',true), array('controller' =>'Dashboard', 'action' =>'agenda'),array('class'=>'shortcut-agenda','title'=>'Agenda'));
        */?>
    </li>-->
</ul>